import { createRouter, createWebHashHistory,createWebHistory } from "vue-router";
 
 
let routes= [
    {
        path: '/',
        redirect:'/login'
    },
    {
        path: '/login',
        name: '/login',
        //使用import可以路由懒加载，如果不使用，太多组件一起加载会造成白屏
        component: () => import('../view/login/login.vue')
    },
   
    {
        path: '/forgetPassword',
        name: '/forgetPassword',
        component: () => import('../view/login/forgetPassword.vue')
    },
    {
        path: '/inde',
        name: 'Index',
        component: () => import('../view/home/index.vue'),
        children: [
          
         
            {
                path: '/systemManage/workType',
                name: '/systemManage/workType',
                component: () => import('../view/systemManage/workType/workType.vue'),
                meta: {
                    title: "工作三种人",
                }
            },
          
            {
                path: '/noPermission',
                name: '/noPermission',
                component: () => import('../view/noPermission/noPermission.vue'),
                meta: {
                    title: "暂无权限",
                }
            },
            {
                path: '/integratedServices/schedulingManage',
                name: 'schedulingManage',
                component: () => import('../view/integratedServices/schedulingManage/schedulingManage.vue'),
                meta: {
                    title: "排班管理"
                }
            },
            {
                path: '/integratedServices/overhaul',
                name: 'overhaul',
                component: () => import('../view/integratedServices/overhaul/overhaul.vue'),
                meta: {
                    title: "检修报修"
                }
            },
            {
                path: '/workManagement/teamMeeting',
                name: 'teamMeeting',
                component: () => import('../view/workManagement/teamMeeting/teamMeeting.vue'),
                meta: {
                    title: "排班管理"
                }
            },
            {
                path: '/workManagement/regularWork',
                name: 'regularWork',
                component: () => import('../view/workManagement/regularWork/regularWork.vue'),
                meta: {
                    title: "定期工作"
                }
            },
            {
                path: '/workManagement/regularWorkAdd',
                name: 'regularWorkAdd',
                component: () => import('../view/workManagement/regularWork/regularWorkAdd.vue'),
                meta: {
                    title: "定期工作新增",
                    noAside:true
                }
            },
            {
                path: '/workManagement/regularWorkDetails',
                name: 'regularWorkDetails',
                component: () => import('../view/workManagement/regularWork/com_configure/regularWorkDetails.vue'),
                meta: {
                    title: "定期工作查看"
                }
            },
            {
                path: '/integratedServices/receivingRules',
                name: 'receivingRules',
                component: () => import('../view/integratedServices/overhaul/receivingRules.vue'),
                meta: {
                    title: "检修报修-接收规则",
                    noAside:true
                }
            },
            {
                path: '/integratedServices/ticketType',
                name: 'ticketType',
                component: () => import('../view/integratedServices/overhaul/ticketType.vue'),
                meta: {
                    title: "检修报修-工单类型",
                    noAside:true
                }
            },
            {
                path: '/integratedServices/addOnDuty',
                name: 'addOnDuty',
                component: () => import('../view/integratedServices/schedulingManage/components/onDuty/addOnDuty.vue'),
                meta: {
                    title: "新增值班排班",
                    noAside:true
                }
            },
            {
                path: '/integratedServices/teamConfig_onDuty',
                name: 'teamConfig_onDuty',
                component: () => import('../view/integratedServices/schedulingManage/components/onDuty/teamConfig_onDuty.vue'),
                meta: {
                    title: "值班排班-班组配置",
                    noAside:true
                }
            },
            {
                path: '/integratedServices/addDaily',
                name: 'addDaily',
                component: () => import('../view/integratedServices/schedulingManage/components/daily/addDaily.vue'),
                meta: {
                    title: "新增排班",
                    noAside:true
                }
            },
            {
                path: '/integratedServices/teamConfig_daily',
                name: 'teamConfig_daily',
                component: () => import('../view/integratedServices/schedulingManage/components/daily/teamConfig_daily.vue'),
                meta: {
                    title: "值班排班-班组配置",
                    noAside:true
                }
            },
        ]
    },
]
// 路由
const router = createRouter({
    // history: createWebHashHistory(import.meta.env.VITE_BASE_URL),
    history: createWebHistory(import.meta.env.VITE_BASE_URL),
    routes
})
// 导出
export default router 